/*******************************************************************************
 * IDataRetriever.h
 *
 * Copyright (c) 2012, Varuna L Amachi. All rights reserved.
 *
 * This program/library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This program/library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 ******************************************************************************/

#ifndef IDATARETRIEVER_H
#define IDATARETRIEVER_H


#include "core/model/SavedPlaylist.h"
#include "core/TanyatuCoreGlobal.h"
#include "core/model/AlbumInfo.h"
#include "core/model/ArtistInfo.h"
#include "core/model/StoredAudio.h"

#include <QHash>
#include <QSet>
#include <QVariant>


namespace Tanyatu {

namespace DataSource {

class TANYATU_CORE_EXPORT IDataRetriever {

protected:

    IDataRetriever() { /*NOTHING TO DO*/ }

public:
    virtual bool getStoredAudio(
            QHash< QString, Model::StoredAudio*> &items ) = 0;

    virtual bool getHistory(
            QList< QPair< QString, QDateTime > *> &recentIds) = 0;

    virtual bool getTrackIdsFromArtist( QString artistName,
                        QSet< QString > &trackIds ) = 0;

    virtual bool getAlbumIdsFromArtist( QString artistName,
                        QSet< QString > &albumIds ) = 0;

    virtual bool getTrackIdsFromAlbum( QString artistName,
                                       QString albumName,
                        QSet< QString > &trackIds ) = 0;

    virtual bool getAllArtists(
            QHash< QString, Model::ArtistInfo *> &artist ) = 0;


    virtual bool getAllAlbums( QHash< QString, Model::AlbumInfo *> &albums) = 0;

    virtual bool getPlaylists(
            QHash< QString, Model::SavedPlaylist *> &playlists) = 0;

    virtual bool getPlaylistContent( QString playlistName,
            QList< QString > &trackIds ) = 0;

    virtual int getPlayCount( QString trackId ) = 0;

    virtual Model::MediaRating getRating( QString trackId )            = 0;

    virtual bool getSettings( QHash< QString, QVariant > settings)      = 0;

    virtual QList< Model::MediaItem * > getSavedCurrentPlaylist() = 0;

    virtual ~IDataRetriever() { /*NOTHING TO DO*/ }
};
}
}

#endif // IDATARETRIEVER_H
